<admintpl file="header"/>
</head>
<body>
<div class="wrap">
    <form method="post" class="form-horizontal " id="myform"  action="{:U('Admin/Message/editstatus')}">
        <div class="control-group">
            <label class="span1 control-label" style="width: 90px;">更新状态</label>
            <div class="span3">

                <input type="hidden" name="id" id="id" value="<?php echo $id;?>">
                <tr id="set_type_tr">
                    <td>
                        <select class="select_2" name="type" id="set_status" style="width: 105px;">
                            <option value="">--请选择--</option>
                            <option value="0" <?php if($status == 0){echo "selected";}?>>未开始</option>
                            <option value="1" <?php if($status == 1){echo "selected";}?> >已开始</option>
                            <option value="2" <?php if($status == 2){echo "selected";}?> >已结束</option>
                        </select>
                    </td>
                </tr>
            </div>
        </div>

        <div class="form-actions" style="padding-left:260px; margin-top: 100px;">
            <a class="btn btn-primary" id="ajaxform">提 交</a>
            &nbsp;&nbsp;<a class="btn" id="ajaxback">{:L('BACK')}</a>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript"
        src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>
<script>
    // ajax 提交表单
    $(document).ready(function(){
        $("#ajaxform").click(function(){    // 提交按钮触发事件
            var tourl = $("#myform").attr("action");    // 获取 表单的 提交地址
            var id = $("#id").val();
            var set_status = $("#set_status").val();
            var edit = 1;
            $.post(tourl,{id:id,status:set_status,edit:edit},function(result){
                if(result == '1'){
                    var msg = '编辑成功';
                }else{
                    var msg = '编辑失败';
                }

                parent.layer.msg(msg,{time:2000},1,function(a){

                });
                setTimeout(function(){
                    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                    parent.layer.close(index);
                }, 1000);
            });
        });
        $("#ajaxback").click(function(){
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.layer.close(index);
        });
    });
</script>
</body>
</html>